#ifndef _ENV_CTROL_SERVICE_H
#define _ENV_CTROL_SERVICE_H

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include<unistd.h>
#include <signal.h>

#include "modbus_dev_driver.h"
#include "uart_driver.h"
#include "cmd_deal.h"
#include "usb_hotplug_check.h"

#define SHIJU_LIGHT_MODULATOR_ID 0X01
#define IR_SENSOR_ID 0X02
#define DIKONG_LIGHT_MODULATOR 0X03
#define DIKONG_LIGHT_MODULATOR 0X03
#define ILLUMINANCE_SENSOR_ID 0X04

typedef enum
{
    USB_SERIAL_DEVICE_INIT_FAIL = 0X00,
    USB_SERIAL_DEVICE_INIT_OK = 0X01,
}USB_SERIAL_DEVICE_INIT_STATE_STRU;

extern int init_modbus_device_server(uint8_t channel,uint32_t buatrate);
extern int init_duya_curtain_device_server(uint8_t ,uint32_t);
extern int init_somfy_curtain_device_server(uint8_t ,uint32_t);
extern int init_usb_serail_device_server(uint8_t prototype,uint8_t channel,uint32_t bautrate);

extern int init_usbserial_hotplug_server(void);

extern int get_modbus_device_Info(int devid,int datatype,int startaddr,int num,int *pvalue);
extern int set_modbus_device_Info(int devid,int datatype,int startaddr,int num,int *pvalue);
extern int curtain_motor_device_control_info(int prototype,int devid,int funcode,int startaddr,int num,int *pvalue);
extern int init_TCP_server(void);
#endif
